package com.example.larou.Impl;

import cn.dev33.satoken.util.SaResult;
import com.example.larou.entity.Item;
import com.example.larou.mapper.ItemMapper;
import com.example.larou.utils.Adapter;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

@Service
public class DeleteItemServiceImpl extends Adapter {
    @Resource
    private ItemMapper itemMapper;
    @Override
    public SaResult deleteItem(int item_id){
        boolean delete = itemMapper.deleteItem(item_id);
        if (delete){
            return  SaResult.ok("删除物品成功");
        }
        return SaResult.error("删除失败");
    }

    public SaResult deleteCartItem(int cart_id) {
        boolean delete = itemMapper.deleteCartItem(cart_id);
        if (delete){
            return  SaResult.ok("删除物品成功");
        }
        return SaResult.error("删除失败");
    }
}
